﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Resources;
using Path = System.Windows.Shapes.Path;

namespace Sonce.Editor
{
	public partial class Editor
	{
		#region Transformations
		/// <summary>
		/// Flip element horizontally or vertically.
		/// </summary>
		/// <param name="element">FrameworkElement</param>
		/// <param name="horizontal">True to flip it by the X axis.</param>
		/// <param name="vertical">True to flip it by the Y axis.</param>
		public void Flip(FrameworkElement element, bool horizontal, bool vertical)
		{
			this.layoutManager.Flip(element, horizontal, vertical);
		}

		public void Flip(bool horizontal, bool vertical)
		{
			foreach (FrameworkElement element in this.SelectedElements)
			{
				this.layoutManager.Flip(element, horizontal, vertical);
			}
		}

		/// <summary>
		/// Scale element proportionally.
		/// </summary>
		/// <param name="element">FrameworkElement</param>
		/// <param name="ratio">Scale ratio. Value 1.0 means original size, lower is smaller, higher is larger, negative is flip.</param>
		public void Scale(FrameworkElement element, double ratio)
		{
			this.layoutManager.Scale(element, ratio, ratio);
		}

		/// <summary>
		/// Scale element. Use this method also if you want to flip while scaling.
		/// </summary>
		/// <param name="element">FrameworkElement</param>
		/// <param name="scaleX">Scale ratio for the X axis. Value 1.0 means original size, lower is smaller, higher is larger, negative is flip.</param>
		/// <param name="scaleY">Scale ratio for the Y axis. Value 1.0 means original size, lower is smaller, higher is larger, negative is flip.</param>
		public void Scale(FrameworkElement element, double scaleX, double scaleY)
		{
			this.layoutManager.Scale(element, scaleX, scaleY);
		}
		#endregion
	}
}
